﻿#region Header

/*
Remote views based on linq
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using System;
using System.Collections.Generic;
using Sebarf.Security.Interfaces;

#endregion

namespace Sebarf.Security.Authentication {
	/// <summary>
	/// This request is used for username/password authentication
	/// </summary>
	[Serializable]
	public class UsernamePasswordAuthenticationRequest : DoAuthenticationRequest {
		public const string PASSWORD_MD5_HASH_FIELD = "PasswordMD5Hash";
		public const string USERNAME_FIELD = "Username";

		#region Public Properties

		/// <summary>
		/// The username which should be authenticated
		/// </summary>
		public string Username {
			get { return AuthenticationArguments[USERNAME_FIELD].ToString(); }
			set { AuthenticationArguments[USERNAME_FIELD] = value; }
		}

		/// <summary>
		/// The password belonging to the user.		
		/// </summary>
		public string PasswordMD5Hash {
			get { return AuthenticationArguments[PASSWORD_MD5_HASH_FIELD].ToString(); }
			set { AuthenticationArguments[PASSWORD_MD5_HASH_FIELD] = value; }
		}

		#endregion

		#region Public Methods

		public UsernamePasswordAuthenticationRequest()
			: base(
				new KeyValuePair<String, Object>(USERNAME_FIELD, string.Empty),
				new KeyValuePair<String, Object>(PASSWORD_MD5_HASH_FIELD, string.Empty)) {
		}

		#endregion
	}
}